﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CMS.BLL;


public partial class Introduction : System.Web.UI.Page
{
    int nCurentLanguage = Support.GetCurrentLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack){
            this.GetPage();
        }
        
    }


    private void GetPage()
    {
        try
        {
            int nPageID = ConvertData.ConvertToInt(Request.QueryString[Config.PAGE_ID]);
            StaticPages objStatic = new StaticPages();
            objStatic.LoadById(nPageID);

            switch (nCurentLanguage)
            {
                case 1:
                    lblTitleIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageName1).ToUpper();
                    ltrContentIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageContent1);
                    break;
                case 2:
                    lblTitleIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageName2).ToUpper();
                    ltrContentIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageContent2);
                    break;
                case 3:
                    lblTitleIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageName3).ToUpper();
                    ltrContentIndotruction.Text = ConvertData.ConvertToString(objStatic.Data.PageContent3);
                    break;
            }

            imgIntroduct.ImageUrl = Config.ROOT + Config.IMAGE_STATICPAGE_DEFAULT_UPLOAD + objStatic.Data.Images; 
        }
        catch
        {

            string sURL = Config.ROOT + Pages.FrontEnds.HOME;
            Response.Redirect(sURL);
        }
    }
}